/**
 * \file SymbolTable.h
 * \brief Represents the symbol table used by the compiler
 * 
 * A symbol table is a structure that can store generic metadata useful
 * for the compiler to semantically analyze the source file.
 * 
 * Kaboom symbol table is a particular hash table. To understand it, we have to
 * understand how single source files interact with eachother.
 * From the top, kaboom files are store in packages, called *TNT boxes*.
 * TNT box are just folders storing 3 type of data:
 * \li <i>sources files</i>: can be either *label file*s or *class file*s;
 * \li other TNT boxes;
 * \li <i>localtable</i>: the local sector of the symbol table;
 *
 * While Label files are files storing a list of *accessgroup label*s, class files
 * store one class source data per file. The source files are optional: this means
 * a TNT can easily lives without storing the source file, because for the compile pahse
 * they are not needed.
 *
 * The essential element needed by the compiler is the the localtable.
 * A localtable is a file storing the symbol table of the given TNT package:
 * so, it stores all the accessgroup labels defined in the package and ALL
 * the information about the classes in the given package. The localtable
 * is structured as followed:
 *
 * <table>
 * 	<tr>
 * 		<th>Number of Bytes</th>
 * 		<th>Name</th>
 * 		<th>Description</th>
 * 	</tr>
 * 	<tr>
 * 		<td>unsigned int</td>
 * 		<td>class hashtable length</td>
 * 		<td>Indicates the length of an array storing the relative pointers of the classes</td>
 * 	</tr>
 * 	<tr>
 * 		<td>unsigned int</td>
 * 		<td>name hashtable length</td>
 * 		<td>Indicates the length of an array storing the relative pointer of the names used in this package</td>
 * 	</tr>
 * 	<tr>
 * 		<td>unsigned int</td>
 * 		<td>IDs list hashtable length</td>
 * 		<td>Indicates the length of an array storing the relative pointer of the ID lists used in this package</td>
 * 	</tr>
 * 	<tr>
 * 		<td>unsigned int</td>
 * 		<td>schema hashtable length</td>
 * 		<td>Indicates the length of an array storing the relative number of the schemas used in this package</td>
 * 	</tr>
 * 	<tr>
 * 		<td></td>
 * 		<td></td>
 * 		<td></td>
 * 	</tr>
 *
 * </table>
 *
 *
 * Let's try to understand better this concept by imaging to retrieving a localresource called "i". We have this environment:
 * - class A:
 * 	-* field a;
 * 	-* field b;
 * 	-* function c:
 * 		- local variable a1;
 * 		- local variable a2;
 * 		- local variable a3;
 * 	-* function d:
 * 		- local variable a1;
 * 		- local variable a2;
 * - class B:
 * 	-* field a;
 * 	-* function b:
 * 		- local variable i;
 * 		- local variable i2;
 * 	-* field c;
 * - class C:
 * 	-* function a:
 * 		- local variable i;
 * 	-* field b;
 *
 * The retrieving of "i" is not so easy: first of all we need to get "i" in the class B or C? Let's assume we want the B one.
 * So we need to follow the path B->b->i;
 * To do so, we need:
 * -# load the ClassHeap of the given TNT package;
 * -# look in a class hashtable, containing all the relative pointers of every class owned by the package, for the class B;
 * -# thanks to the relative pointer, now we are in the heap and we have retrieved the class structure: in this structure
 * 	we have a field which stores the relative pointer of an hashtable containing the resources owned by this class. We follow this pointer;
 * -# thanks to the relative pointer now we are in the heap and we are at the beginning of
 * 	hashtable associating every resource of the class B. Note that every class in the package has a *different* resource
 * 	hashtable: in this way we reduce conflict between functions/fields with the same name in different classes;
 * -# we can select the resource named "b" in the resource hashtable: the names inside it are unique, so we can do it easily;
 * -# we get the associated relative pointer of the name "b";
 * -# thanks to the relative pointer we are in the heap and we are at the beginning of the structure of the function "b": in it
 * there is also a relative pointer to a localresource hashtable. We follow it. Note that there are multiple localresource hashtable
 * inside the heap, one per each function inside all the classes in the package;
 * -# thanks to the relative pointer we are now at the beginning of the localresource hashtable sotred in the heap. We get the
 * relative pointer of the string "i": We retrieve a relative pointer;
 * -# thanks to the the relative pointer we now have the data relative to the "i" variable;
 *
 * The other pointers used by the structures representing the various sub elements of the class are scattered
 * throughout all the heap, like:
 *  - the names of the classes;
 *  - the names of the labels;
 *  - the names of the resources;
 *  - the names of the local resources;
 *  - the ID lists representing access groups, membership groups, read groups, write groups;
 *  - formal parameters list for each function in every class delcared in the TNT packages;
 *
 * \date Nov 20, 2013
 * \author koldar
 */

#ifndef SYMBOLTABLE_H_
#define SYMBOLTABLE_H_

#endif /* SYMBOLTABLE_H_ */
